
        window.webSetting = {
            // 设计稿屏幕宽度
            designWidth: 1920,
            limitWidth: 1280
          };
          
          function initFontSize() {
            var baseWidth = document.documentElement.clientWidth >= window.webSetting.limitWidth ? document.documentElement.clientWidth : window.webSetting.limitWidth;
            document.documentElement.style.fontSize = (baseWidth / (window.webSetting.designWidth / 100)) + "px";
          }
          
          initFontSize();
          window.addEventListener("resize", initFontSize);
var isshow = false;
$(function(){
    mywindow = $(window);
    $("img").lazyload({
        effect : "fadeIn"
    });
    mywindow.scroll(function () {
        if (mywindow.scrollTop() <= 400) {
            $('#menu').removeClass('on');
        }else{
            $('#menu').addClass('on');
        }
    });
    var isOut = false;
    $(".navigation li").hover(function(){
        $(this).addClass("on");
        
    },function(){
        $(this).removeClass("on");
    });
    
    taps($('#nav'),function(){
        if(isshow){
            $('.navigation').hide();
        }else{
            $('.navigation').show();
        }
        isshow = !isshow;
    });
    
    
});


//验证车牌号码
function verCarCard(no){
    if(/^[京津渝沪冀晋辽吉黑苏浙皖闽赣鲁豫鄂湘粤琼川贵云陕甘青蒙桂宁新藏][A-z][a-hj-np-zA-HJ-NP-Z\d]{4,5}[领学警挂港澳试超a-hj-np-zA-HJ-NP-Z\d]$|^[使][\d]{6}$|^[A-z]{2}[\d]{5}$|^WJ[京津渝沪冀晋辽吉黑苏浙皖闽赣鲁豫鄂湘粤琼川贵云陕甘青蒙桂宁新藏]?[\d]{4}[\dA-z]$/.test(no)){
        return true;
    }
     return false;  
    
}
function trim(str){ //删除左右两端的空格
	return str.replace(/(^\s*)|(\s*$)/g, "");
}
function ltrim(str){ //删除左边的空格
	return str.replace(/(^\s*)/g,"");
}
function rtrim(str){ //删除右边的空格
	return str.replace(/(\s*$)/g,"");
}
function filter_input(str){
    return str.replace(/(<)/g,"&lt;").replace(/(>)/g,"&gt;");
}

function matchUserName(val){
	var valnew = trim(val);
	var re1=/^[~!@#$%^&*()-+={}|;:<>?.,~！@#￥……&*（）+=｛｝【】|、：；"'《》、？，。]/i;
	if(valnew == ""){
		return false;
	}
	if(re1.test(valnew)){
		return false;
	}
	if(valnew.length<2||valnew.length>20){
		return false;
	}
}

function matchEmail(val){
	var valnew = trim(val);
	if(valnew.match( /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/)){
		return true;
	}else{
		return false;
	}
}

function matchMobile(val){
	var valnew = trim(val);
	if(valnew.match(/^(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])\d{8}$/)){
		return true;
	}else{
		return false;
	}
}
/*点击*/
var tap_id = undefined,tap_move = false;
function tap(el,func,className,justFirst,els,i){
    if(!el)return;
    function tap_start(ev){
        if(!justFirst || (justFirst && tap_id == undefined)){
            tap_id = el.id;
            tap_move = false;
        
            if(className && !el.classList.contains(className)){
                el.classList.add(className);
            }
        }
        
    }
    function tap_move(ev){
        tap_move = true;
        if(className && el.classList.contains(className)){
            el.classList.remove(className);
        }
    }
    function tap_end(ev){
        
        if(className && el.classList.contains(className)){
            el.classList.remove(className);
        }
        if(tap_id == el.id && !tap_move){
            ev.stopPropagation();
            ev.preventDefault();
            if(func){
                func(el,ev,els,i);
            }
            tap_id = undefined;
            return false;
        }
        tap_id = undefined;
        return false;
    }
    el.addEventListener("touchstart",tap_start,false);
    el.addEventListener("touchmove",tap_move,false);
    el.addEventListener("touchend",tap_end,false);
}
function tap_one(el,func,className){
    if(!el)return;
    function tap_start(){
        event.stopPropagation();
        tap_move = false;
        tap_id = el.id;
        if(className && !el.classList.contains(className)){
            el.classList.add(className);
        }
    }
    function tap_move(){
        tap_move = true;
        if(className && el.classList.contains(className)){
            el.classList.remove(className);
        }
    }
    function tap_one_end(){
        if(className && el.classList.contains(className)){
            el.classList.remove(className);
        }
        if(tap_id == el.id && !tap_move){
            if(func){
                func(el);
            }
            event.preventDefault();
            el.removeEventListener("touchstart",tap_start);
            el.removeEventListener("touchmove",tap_move);
            el.removeEventListener("touchend",tap_one_end);
            return false;
        }
        return false;
    }
    el.addEventListener("touchstart",tap_start,false);
    el.addEventListener("touchmove",tap_move,false);
    el.addEventListener("touchend",tap_one_end,false);
}
function taps(els,func,className,justFirst){
    for(var i=0;i<els.length;i++){
        tap(els[i],func,className||els[i].dataset.tapClass,justFirst,els,i);
    }
}